import request from "@/utils/requset.js";

export const apis = {
  parentQuery: (params) => {
    return request({
      url: "/preventionCheckTaskConfig/list",
      method: "get",
      params,
    });
  },

  query: (params) => {
    return request({
      url: "/check/governCheckTaskPlan/api/userSelf/list",
      method: "get",
      params,
    });
  },
  getAllTaskByUnitId: (params) => {
    return request({
      url: "/preventionUnit/getAllTaskByUnitId",
      method: "get",
      params,
    });
  },

  update: (data) => {
    return request({
      url: "/preventionCheckTaskConfig/update",
      method: "post",
      data: data,
    });
  },
  detail: (data) => {
    return request({
      url: "/preventionCheckTask/" + data,
      method: "get",
    });
  },
  updateTaskState: (data) => {
    return request({
      url: "/preventionCheckTask/updateTaskState",
      method: "post",
      data: data,
    });
  },
  // 查询检查项
  checkTaskItemList: (data) => {
    return request({
      url: "/check/governCheckTaskPlanItem/userSelf/list",
      method: "get",
      data: data
    });
  },
  // 查看检查子任务详情
  getTaskItemDetail: (data) => {
    return request({
      url: `/check/governCheckTaskPlanItem/api/detail/${data}`,
      method: "get"
    });
  },
  // 修改检查计划子任务项状态
  fixCheckTaskItemStatus: (data) => {
    return request({
      url: "/check/governCheckTaskPlanItem",
      method: "put",
      data: data
    });
  }
};
